1. Field of the Invention
The present invention relates to flashing an image in a non-volatile memory, and more specifically to forcing the system into a boot block recovery mode even when the non-volatile memory is not corrupt.
2. Description of the Related Art
The pursuit of low maintenance computers has been a defining issue among personal computer manufacturers for many years. The satisfaction of a personal computer (PC) user is related to the reliability of the PC and to the ease of the troubleshooting/correction procedures. PC""s that require a low level of maintenance or eliminate troubleshooting and repair by outside technicians have advantages over maintenance intensive PC""s. An error which often exceeds the average user""s skill level is when the PC""s system programmable Read Only Memory (ROM) becomes corrupt.
Historically ROM, which is non-volatile, was not in-system updatable. ROM memories store code and data required to initialize and operate a system. However, as system enhancement and upgrades became common, the desirability of an updatable ROM increased. A need for an updatable ROM was met by the creation of the Electrically-Erasable-Programmable-Read-Only-Memory (EEPROM). The EEPROM is in-system writable and non-volatile. The EEPROM, by means of an electric pulse, can be programmed and erased. A more recent innovation in the memory technology field is flash ROM. Flash ROM is inherently non-volatile and allows for in-system updateability. Flash ROM can be updated by xe2x80x9cflashingxe2x80x9d a new ROM image on to the chip, while the system is operational, from a variety of possible sources, including removable media devices, modem links, or parallel or serial connectors.
Flash ROMs are frequently used to store embedded code in the PC. A PC system ROM traditionally contains the resident code that runs the system. A Basic Input/Output System (BIOS) is a typical embedded code storage application of the PC. The BIOS is low level code interfacing the operating system to the specific hardware implementation. Typical BIOS functions include the initialization of disk drives, including floppy, hard, and compact, and initialization of the video and graphical interfaces. The BIOS is specifically configured for each PC based on the presence of specific hardware and the current version or manufacturer of the hardware. If the PC hardware is updated or modified, the BIOS may need to be upgraded to properly initialize the new hardware. An updated BIOS can be flashed, by the user, to the flash ROM, after the user has replaced or upgraded a component to the PC.
A potential problem exists when an updated BIOS is flashed. An incorrect BIOS could inadvertently be flashed or the flash could be interrupted resulting in a corrupted ROM. If this occurs, the system would not initialize. To prevent this, the flash ROM memory array is divided into two distinct sections, the boot block and the main block. The previously discussed applications have all resided in the main block of the flash ROM. The boot block of the flash ROM is protected from an ordinary flash, and that data will remain even after a corrupted flash ROM image is flashed.
The boot block can thus be used to store kernel code necessary to initialize the basic components of the system if a corrupted ROM image is present. This may be no more than code sufficient to allow the corrupted ROM to be re-flashed. Typically, the boot block code cannot be altered by standard ROM power levels, such as 3-5 volts, the levels necessary to perform an in-system ROM flash. Instead, the boot block code is usually programmed by using higher voltage levels, such as 12 volts. Therefore even if the ROM is incorrectly flashed because of the code present in the boot block, the system will still initialize enough to allow the user to flash the correct ROM image to the flash ROM, using the techniques discussed above. The boot block traditionally contains the initialization routines for a floppy disk and a keyboard, but no video interface.
Typically, to determine if a flash ROM is corrupt, the computer system verifies the validity of the flash ROM by using a checksum. A checksum is typically calculated by adding all the bytes in the flash ROM; this value should equal a predetermined amount, the checksum amount. If the value does not equal the checksum amount, then the computer system determines that the flash ROM is corrupt and proceeds to execute the boot block code. If the value equals the checksum amount, the computer system determines the flash ROM is not corrupt, and executes the system block code.
A potential problem exists if a corrupt flash ROM""s checksum value does equal the checksum amount by chance, if a virus infected image has previously been loaded into the flash ROM, or if it is otherwise desired or necessary to re-flash the ROM without a normal system boot. In these cases, the computer proceeds with a regular boot even though the flash ROM is corrupt. Techniques that enhance the flexibility of re-flashing a ROM would be desirable.
With the increase in distributed networks and the abilities of PCs to link to each other and to link to various networks, improvements in PC security is desirable. Historically, a PC could be xe2x80x9csecuredxe2x80x9d by physical isolation. Today""s networked environment, however, makes such total isolation impractical. Therefore, techniques that enhance security of PCs would also be desirable.
A method, apparatus, and computer system according to the invention that forces the computer system into boot block recovery even if there is no internal indication that a re-flash is necessary. The apparatus or computer system determines, during power-up, if an input device has been initialized. If the input device has been initialized, the computer system monitors the input device to see if an input is entered. If an input is entered within a predetermined period, the computer system compares the input to a predetermined recovery input. If the input matches the predetermined recovery input, then the computer system executes the code contained in the boot block rather than the other portion of the flash.